package com.caocaog.market.merchant.controller;

import com.caocaog.market.merchant.entity.MkMerchantBasic;
import com.caocaog.market.merchant.service.MkMerchantService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequiredArgsConstructor
@Api(value = "merchantApi", tags = "API商家信息")
@RequestMapping("/api/merchant")
public class ApiMerchantController {
    @Autowired
    private MkMerchantService mkMerchantService;

    @ApiOperation(value = "商家信息",response = MkMerchantBasic.class)
    @PostMapping("/getMerchantInfo")
    public Result getMerchantInfo(@RequestParam("merchantId")String merchantId) {

        MkMerchantBasic merchantBasic = mkMerchantService.getById(merchantId);

        return Result.OK(merchantBasic);
    }
}
